﻿@{
    ViewBag.Title = "报表详情（出口）";
}

@section Header {
    <a href="#" data-rel="back" data-role="button">返回</a>
    <h1>@ViewBag.Title</h1>
}

@{
    var dd = ViewBag.data;

    var cc = dd[0];

    var currentdatetime = DateTime.Now.AddDays(1).Day;

    for (int i = 0; i < currentdatetime; i++)
    {
        <ul data-role="listview" data-inset="true">
            <li data-role="list-divider" data-theme="b">@(DateTime.Now.AddDays(1).ToString("yyyy-MM") + "-" + (currentdatetime - i))</li>
            <li>
                <table data-role="table" data-mode="columntoggle" id="table-custom-2" class="ui-responsive table-stroke">
                    <thead>
                    <th>门点</th>
                    <th>计划</th>
                    <th>完成</th>
                    </thead>
                    <tbody>
                        @{
                                var han = dd.Count;
                                var str1 = "f_" + i + "_1";
                                var str2 = "f_" + i + "_2";
                                for (int j = 1; j < han; j++)
                                {
                                  
                                    var plan = (dd[j])[str1].ToString();
                                    var complete = (dd[j])[str2].ToString();
                                    var num = 1;
                                    if (!string.IsNullOrEmpty(plan))
                                    {
                                        <tr>
                                            <td>@dd[j].address</td>
                                            <td>@plan</td>
                                            <td>@complete</td>
                                        </tr>
                                    }
                                    else
                                    {
                                        num++;
                                    }
            
                                }
                                <tr>
                                    <td>合计</td>
                                    <td>@(dd[0][str1].ToString())</td>
                                    <td>@(dd[0][str2].ToString())</td>
                                </tr>
                        }
                    </tbody>
                </table>

            </li>
        </ul>
    }

    <ul data-role="listview" data-inset="true">
        <li data-role="list-divider" data-theme="b">本月小计</li>
        <li>
            <table data-role="table" data-mode="columntoggle" id="table-custom-2" class="ui-responsive table-stroke">
                <thead>
                <th>门点</th>
                <th>计划</th>
                <th>完成</th>
                </thead>
                <tbody>
                    @{
                        var han1 = dd.Count;
                        for (int i = 0; i < han1; i++)
                        {
                            <tr>
                                <td>@dd[i].address</td>
                                <td>@dd[i]["sum1"].ToString()</td>
                                <td>@dd[i]["sum2"].ToString()</td>
                            </tr>
                        }

                    }
                </tbody>
            </table>
        </li>
    </ul>
}

<script type="text/javascript">
    $(function () {
        $(document).on("pagecreate", function (event) {
            var cc = $("li table").prev("a");
            cc.hide()
        });
    });
</script>



